package com.codegeek.project.slope.domain;

import com.codegeek.common.utils.ReplaceIllegalChar;
import com.codegeek.framework.aspectj.lang.annotation.Excel;
import com.codegeek.framework.web.domain.BaseEntity;
import com.codegeek.project.mybatisTypeHandler.struct.CGSensorTypeParam;
import lombok.Data;

import java.util.List;

/**
 * 传感器对象 slope_sensor
 *
 * @author codegeek
 * @date 2020-02-20
 */
@Data
public class SlopeSensor extends BaseEntity {
    private static final long serialVersionUID = 1L;

    /**
     * ID
     */
    private Long sensorId;

    /**
     * IMEI号
     */
    @Excel(name = "IMEI号")
    private String imei;

    /**
     * 类型
     */
    @Excel(name = "类型")
    private Integer sensorTypeId;

    /**
     * 传感器类型
     */
    private SlopeSensorType sensorType;

    /**
     * 监测内容
     */
    @Excel(name = "监测内容")
    private String monitorDetail;

    /**
     * 新传感器
     */
    @Excel(name = "新传感器")
    private Long alterSensor;

    /**
     * 所属设备ID
     */
    @Excel(name = "所属设备ID")
    private Long deviceId;

    private SlopeDevice device;

    /**
     * 基本参数
     */
    @Excel(name = "基本参数")
    private List<CGSensorTypeParam> baseParams;

    /**
     * 传感器监测项
     */
    @Excel(name = "监测项")
    private List<SlopeMonitorItem> monitorItems;

    private List<SlopeAlarm> alarmList;

    private Integer statusOption;

    private String deviceName;

    private String deviceNumber;

    private Integer repairTimes;

    private Integer isValid;

    public void setImei(String imei) {
        this.imei = new ReplaceIllegalChar().replace(imei);
    }

    public void setMonitorDetail(String monitorDetail) {
        this.monitorDetail = new ReplaceIllegalChar().replace(monitorDetail);
    }

    public void setDeviceName(String deviceName) {
        this.deviceName = new ReplaceIllegalChar().replace(deviceName);
    }

    public void setDeviceNumber(String deviceNumber) {
        this.deviceNumber = new ReplaceIllegalChar().replace(deviceNumber);
    }
}
